package xiji.chongqing.com.gasmanaget;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.ImageView;

import java.util.ArrayList;
import java.util.List;

public class MainActivity extends AppCompatActivity {
    private List<ImageCycleView.ImageInfo> mImageUrls = new ArrayList<>();
    private ImageCycleView imageCycleView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        mImageUrls.add(new ImageCycleView.ImageInfo(R.drawable.bannerone, "", ""));
        mImageUrls.add(new ImageCycleView.ImageInfo(R.drawable.bannertwo, "", ""));
        mImageUrls.add(new ImageCycleView.ImageInfo(R.drawable.bannerthree, "", ""));
        imageCycleView = (ImageCycleView) findViewById(R.id.ad);

        imageCycleView.loadData(mImageUrls, new ImageCycleView.LoadImageCallBack() {
            @Override
            public ImageView loadAndDisplay(ImageCycleView.ImageInfo imageInfo) {

                ImageView imageView = new ImageView(MainActivity.this);
                imageView.setImageDrawable(getResources().getDrawable((Integer) imageInfo.image));
                return imageView;
            }
        });





    }
}
